
//鉴权
function Authenticate(token){

var request = require('request');
var url="http://39.108.215.169:10239/api/services/app/UserLogin/GetRecentUserLoginAttempts";
var flag=false;
var options = {
    url: url,
    headers: {
        'accept': 'text/plain',
        'Content-Type':'application/json-patch+json',
        'Authorization':'Bearer '+token
    }
};
function callback(error, response, body) {

    if(!error&&response.statusCode==200){
        const temp=JSON.parse(body);
        if(temp.success){
             flag=true;
             return flag;
        }
        else{
            flag=false;
            return flag;
        }
        
    }
 
}

return request(options,callback);

}
module.exports.Authenticate=Authenticate;